import type { AddCardParams, areaData, cardList, CardListParams, cardListParams, carPayData, CarRuleParams, dropList, EmptyObject, ParkingParams, ParkPayData } from "@/types/car";
import { request } from "@/utils/reuqest";

// 获取月卡列表
export const getCard=(params:cardListParams)=>{
    return request<cardList>('/parking/card/list','get',params)
}
// 添加月卡
export const addCard=(params:Partial<AddCardParams>)=>{
    return request('/parking/card','post',params)
}
// 删除月卡
export const deleteCard=(ids:number[])=>{
    return request(`/parking/card/${ids}`,'delete')
}
// 查看详情月卡
export const editDetailCard=(id:number)=>{
    return request<AddCardParams>(`/parking/card/detail/${id}`,'get')
}
// 编辑月卡
export const editCard=(params:Partial<AddCardParams>)=>{
    return request('/parking/card/edit','put',params)
}
// 查看停车缴费列表
export const getCardPay=(params:ParkingParams)=>{
    return request<ParkPayData>('/parking/rule/list','get',params)
}
// 停车缴费
export const CarPay=(data:CardListParams)=>{
    return request<carPayData>('/parking/payment/list','get',data)
}
// 区域管理
export const AreaList=(data:CarRuleParams)=>{
    return request<areaData>('/parking/area/list','get',data)
}
// 获取关联区域下拉列表
// GET
// https://api-hmzs.itheima.net/api/parking/area/dropList
export const dropListAPI=()=>{
    return request<dropList[]>('/parking/area/dropList')
}
// 添加区域
// POST
// https://api-hmzs.itheima.net/api/parking/area
export const AddAreaAPI=(data:EmptyObject)=>{
    return request('/parking/area','post',data)
}